module.exports._append = function(that){
  /**
   * 根据fight回调发起支付接口 bind（{success ，fail }）
   * this._tool("pay")._append(this)
   * this.fightPay().bind({success: function, fail: function})}) 写在发起回调success里
   */
  that.fightPay = function (){
    return function (res){
      let payment = res.result;
      payment.signType = 'MD5';
      payment.timeStamp += "";
      let order_id = res.order_id;
      payment.complete = function () {
        let checkSuccess = function (ret) {
          if (ret.result == "支付成功") {
            this.success();
          } else {
            this.fail();
          }
        };
        that._request("order").checkPay({ order_id: order_id }, { success: checkSuccess.bind(this) });
      }.bind(this);
      wx.requestPayment(payment);
    }
  };
  
}